import React, { Component } from 'react'
import Child from './components/Child'
import Child1 from './components/Child1'
export default class Page3 extends Component {
    constructor(){
        super();
        this.state={
            num:'',
            msg:""
        }
    }
    setmsg(msg){
        this.setState({
            msg
        })
    }
  render() {
    return (
      <div>
        <h1>父传子接受的数据为{this.state.num}</h1>
        <input ref='num' value={this.state.num} onChange={(e)=>{this.setState({num : e.target.value})}}/>
        <Child num={this.state.num}></Child>
        <Child1 setmsg={this.setmsg}></Child1>
      </div>
    )
  }
}
